    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// 发送验证码
export const sendCode = (mobile:any) => {
    return service({
        url: '/user/index/sendCode/' + mobile,
        method: 'post'
    })
};


// 用户注册
export const userReg = (data:any) => {
    return service({
        url: '/user/index/userReg',
        method: 'post',
        data
    })
};

// 用户登录
export const userLogin = (data:any) => {
    return service({
        url: '/user/index/userLogin',
        method: 'post',
        data
    })
};

// 获取用户的菜单树
export const getMenuTree = () => {
    return service({
        url: '/user/index/getMenuTree',
        method: 'post',
    })
};

// 商户分页列表
export const getShopperList = (data:any) => {
    return service({
        url: '/user/index/getShopperList',
        method: 'post',
        data
    })
};

// 品牌分页列表
export const getBrandList = (data:any) => {
    return service({
        url: '/prod/brand/getBrandList',
        method: 'post',
        data
    })
};

// 获取商品分类的树
export const getTypeList = (data:any) => {
    return service({
        url: '/prod/type/getTypeList',
        method: 'post',
        data
    })
};

// 添加商品分类
export const addType = (data:any) => {
    return service({
        url: '/prod/type/addType',
        method: 'post',
        data: data
    })
};


//获取商品列表
export const getPageListProd = (data:any) => {
    return service({
        url: '/prod/index/getPageListProd',
        method: 'post',
        data: data
    })
};
export const getDictList = (typeId: any) => {
    return service({
        url: '/prod/dict/getDictListByTypeId/' + typeId,
        method: 'post',

    })
};
//获取订单列表
export const getPageListOrder = (data:any) => {
    return service({
        url: '/prod/order/getPageListOrder',
        method: 'post',
        data: data
    })
};
// 商品添加
export const addProd = (data: any) => {
    return service({
        url: '/prod/index/addProd',
        method: 'post',
        data
    })
};
//分类下拉框
export const getSelectTypeTreeList = () => {
    return service({
        url: '/prod/type/getSelectTypeTreeList',
        method: 'post',

    })
};
//品牌下拉框
export const getBrandAll = () => {
    return service({
        url: '/prod/brand/getBrandAll',
        method: 'post',

    })
};
//添加商品附件
export const addProdAtta = (data: any) => {
    return service({
        url: '/prod/index/addProdAtta',
        method: 'post',
        data
    })
};
//批量删除商品
export const deleteBatchProd = (data: any) => {
    return service({
        url: '/prod/index/deleteBatchProd',
        method: 'post',
        data
    })
};
//删除商品
export const deleteProd = (prodId: any) => {
    return service({
        url: '/prod/index/deleteProd/' + prodId,
        method: 'post',
    })
};